﻿<%@ Page Title="Register" Language="C#" MasterPageFile="~/GEMS.master" AutoEventWireup="true"
    CodeFile="Register.aspx.cs" Inherits="register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!----JS validation for  Register --->
    <script language="javascript" type="text/javascript">
        function validate() {
            var Show = '';
            if (document.getElementById("<%=txtname.ClientID %>").value == "") {
                Show = Show + '\n - Enter user Name';
            }

            if (document.getElementById("<%=txtemail.ClientID %>").value == "") {
                Show = Show + '\n - Enter Email ID';
            }
            else {
                var emailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
                var emailid = document.getElementById("<%=txtemail.ClientID %>").value;
                var matchArray = emailid.match(emailPat);
                if (matchArray == null) {

                    document.getElementById("<%=txtemail.ClientID %>").focus();
                    Show = Show + '\n - Enter Valid Email ID';
                }

            }
            if (document.getElementById("<%=txtpwd.ClientID %>").value == "") {
                Show = Show + '\n - Enter  Password';
            }

            if ((document.getElementById("<%=txtpwd.ClientID %>").value) != (document.getElementById("<%=txtconfpwd.ClientID %>").value)) {
                Show = Show + '\n - Enter Correct Password';
            }




            if ((document.getElementById("<%=txtdeliver.ClientID%>").value == "") && (document.getElementById("<%=txtpermnt.ClientID%>").value == "")) {
                Show = Show + ('\n - Enter Your Deliver  / Permanent Address');
            }



            if (Show != '') {
                alert(Show);
                return false;
            }
            else {
                return true;
            }
        }

        function AllowNumericOnly(e) {
            var evt = (e) ? e : window.event;
            var key = (evt.keyCode) ? evt.keyCode : evt.which;
            if (key != null) {
                key = parseInt(key, 10);
                if (key < 48 || key > 57) {
                    if (!jsIsUserFriendlyChar(key, "Decimals")) {
                        return false;
                    }
                }
                else {
                    if (evt.shiftKey) {
                        return false;
                    }
                }
            }
            return true;
        }

        function jsIsUserFriendlyChar(val, step) {
            // Backspace, Tab, Enter, Insert, and Delete  
            if (val == 8 || val == 9 || val == 13 || val == 45 || val == 46) {
                return true;
            }
            // Ctrl, Alt, CapsLock, Home, End, and Arrows  
            if ((val > 16 && val < 21) || (val > 34 && val < 41)) {
                return true;
            }
            if (step == "Decimals") {
                if (val == 190 || val == 110) {  //Check dot key code should be allowed
                    return true;
                }
            }
            // The rest  
            return false;
        }

        function numbersonly(e) {
            var unicode = e.charCode ? e.charCode : e.keyCode
            if (unicode != 8) { //if the key isn't the backspace key (which we should allow)
                if (unicode < 45 || unicode > 57) //if not a number
                    return false //disable key press
            }
            else {
                return true;
            }
        }
    </script>
    <!---- End JS validation for  Register --->
    <!---- JS validation for  Register Clear --->
    <script language="javascript" type="text/javascript">
        function clrCtrl() {
            document.getElementById("<%=txtname.ClientID %>").value = "";
            document.getElementById("<%=txtemail.ClientID %>").value = "";
            document.getElementById("<%=txtpwd.ClientID %>").value = "";
            document.getElementById("<%=txtconfpwd.ClientID %>").value = "";
            document.getElementById("<%=txtmobile.ClientID %>").value = "";
            document.getElementById("<%=txtDate.ClientID %>").value = "";
            document.getElementById("<%=txtdeliver.ClientID %>").value = "";
            document.getElementById("<%=txtpermnt.ClientID %>").value = "";
            document.getElementById("<%=txtname.ClientID %>").focus();


        }

   
    </script>
    <!----End JS validation for  Register Clear --->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="container960">
        <div class="container_12">
            <div id="main">
                <div class="full" style="margin: 0px;">
                    <div class="content">
                        <h2>
                            Registration</h2>
                        <div class="Register">
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="usrlbl" runat="server" Text="User Name"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtname" runat="server" class="field" MaxLength="25" TabIndex="1"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="emaillbl" runat="server" Text="Email ID"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtemail" runat="server" class="field" TabIndex="2"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="pwdlbl" runat="server" Text="Password"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtpwd" runat="server" class="field" TextMode="Password" MaxLength="10"
                                        TabIndex="3"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="cnfmpwdlbl" runat="server" Text="Confirm Password"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtconfpwd" runat="server" class="field" TextMode="Password" TabIndex="4"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="mbllbl" runat="server" Text=" Mobile Number"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtmobile" runat="server" class="field" MaxLength="10" onkeypress="return numbersonly(event)"
                                        TabIndex="5"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="DOBlbl" runat="server" Text="DOB"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:TextBox ID="txtDate" type="text" CssClass="tcal field" runat="server" ReadOnly="True"
                                        TabIndex="6" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="leftcol grid_2">
                                    <asp:Label ID="gen" runat="server" Text="Gender"></asp:Label>
                                </div>
                                <div class="rightcol">
                                    <asp:RadioButton ID="rbtMale" runat="server" CssClass="radio" Text="Male" GroupName="Gender"
                                        TabIndex="7" Checked="True" />
                                    <asp:RadioButton ID="rbt_Female" runat="server" CssClass="radio" Text="Female" TabIndex="7"
                                        GroupName="Gender" />
                                </div>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <div>
                            <h2>
                                Communication Details</h2>
                            <div class="Register">
                                <div class="row">
                                    <div class="leftcol grid_2">
                                        <asp:Label ID="dlylbl" runat="server" Text="Delivery Address"></asp:Label>
                                    </div>
                                    <div class="rightcol ">
                                        <asp:TextBox ID="txtdeliver" runat="server" TextMode="MultiLine" Width="212px" class="field1 txtarea"
                                            TabIndex="8" MaxLength="150"></asp:TextBox>
                                    </div>
                                </div>
                                <br />
                                <br />
                                <div class="row">
                                    <div class="leftcol grid_2">
                                        <asp:Label ID="pmtlbl" runat="server" Text=" Permanent Address"></asp:Label>
                                    </div>
                                    <div class="rightcol ">
                                        <asp:TextBox ID="txtpermnt" runat="server" TextMode="MultiLine" Width="212px" class="field1 txtarea"
                                            TabIndex="9" MaxLength="150"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="row">
                                    <div style="float: right; width: 620px">
                                        <div class="leftcol grid_2">
                                            &nbsp;</div>
                                        <div class="rightcol" style="margin-top: 20px;">
                                            <div class="sub">
                                                <asp:Button ID="btn_Save" runat="server" Text="Save" class="lgin" OnClientClick="return validate();"
                                                    OnClick="btn_Save_Click" TabIndex="10" />
                                                <asp:Button ID="clrbtn" runat="server" Text="Clear" class="lgin" OnClientClick="clrCtrl();"
                                                    TabIndex="11" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
</asp:Content>
